package controller.member;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.memberBean;
import dao.memberDao;

public class deleteuserController implements Controller{
	private memberDao dao;
	public void setDao(memberDao dao){
		this.dao = dao;
	}
	@Override
	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse arg1) throws Exception {
		
		HttpSession session = request.getSession();
		memberBean bean = (memberBean) session.getAttribute("member");
		System.out.println("cont delete " + bean.getMnum());
	
		dao.delete(bean.getMnum());
		session.invalidate();
		
		return new ModelAndView("redirect:/startHome.main");
	}
}
